package com.parse.core;

import java.util.List;

import com.parse.ParseObject;
import com.parse.ParseUser;
import com.parse.api.ParserUtils;
import com.parse.contract.Args;
import com.parse.domain.PaserDomin;
import com.wow.wa.bean.PareValue;
import com.wow.wa.util.ProBeanUtil;
import com.wow.wa.util.ProBeanUtilImpl;

public class ParserUtilsImpl implements ParserUtils {

	private ProBeanUtil proBeanUtil;

	public ParserUtilsImpl() {
		this.proBeanUtil = new ProBeanUtilImpl();
	}

	@Override
	public <T extends PaserDomin> ParseObject makeParseObject(T domainType) {

		final List<PareValue> pVs = //
		this.proBeanUtil//
				.getPareValueByDomain(domainType);//

		final ParseObject object = new ParseObject(//
				domainType.getClass().getSimpleName());

		for (PareValue pv : pVs) {
			object.put(pv.getKey(), pv.getValue());
		}

		// TODO Auto-generated method stub
		return object;
	}

}
